package com.xinqi.modules.chat.enums.group;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BasicEnum;
import lombok.Getter;

/**
 * 在群中的状态 0待审核 1正常
 */
public enum GroupUserStatusEnum implements BasicEnum {
    ZERO(0, "待审核"),
    ONE(1, "正常"),
    TWO(2, "拒绝");
    @Getter(onMethod_ = {@JsonValue})
    private final int code;

    @Getter
    private final String describe;

    GroupUserStatusEnum(int code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static GroupUserStatusEnum of(Integer code) {
        return BasicEnum.of(GroupUserStatusEnum.class, code);
    }
}
